package cn.com.css.taxInspection.gt3.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.mapper.JcAjztTjZxwbMapper;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjZxEntity;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjZxwbEntity;
import cn.com.css.taxInspection.gt3.service.JcAjztTjZxwbService;
import cn.com.css.taxInspection.util.TsBqUtils;


@Service("jcAjztTjZxwbService")
public class JcAjztTjZxwbServiceImpl extends ServiceImpl<JcAjztTjZxwbMapper, JcAjztTjZxwbEntity> implements JcAjztTjZxwbService {

	@Override
	@DS("oracle")
	public IPage<JcAjztTjZxwbEntity> infoPage(JcAjztTjZxwbEntity jcAjztTjZxwbEntity) {
		Page page = new Page(jcAjztTjZxwbEntity.getPage(), jcAjztTjZxwbEntity.getLimit());
		LambdaQueryWrapper<JcAjztTjZxwbEntity> queryWrapper = Wrappers.lambdaQuery();
		
		if(TsBqUtils.isNotNull(jcAjztTjZxwbEntity.getJcry())){
			queryWrapper.eq(JcAjztTjZxwbEntity::getJcry, jcAjztTjZxwbEntity.getJcry());
		}
		if(TsBqUtils.isNotNull(jcAjztTjZxwbEntity.getNd())){
			queryWrapper.eq(JcAjztTjZxwbEntity::getNd, jcAjztTjZxwbEntity.getNd());
		}
		if(TsBqUtils.isNotNull(jcAjztTjZxwbEntity.getSwjgDm())){
			queryWrapper.eq(JcAjztTjZxwbEntity::getSwjgDm, jcAjztTjZxwbEntity.getSwjgDm());
		}
		
		
		IPage<JcAjztTjZxwbEntity> iPage = this.page(page, queryWrapper);
		
		return iPage;
		
	}


}